package com.vanky.graph.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.vanky.graph.pojo.Edge;
import com.vanky.graph.pojo.Result;
import com.vanky.graph.service.EdgeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/edge")
public class MessageController {

    @Resource
    private EdgeService edgeService;

    @GetMapping("/all")
    public Result<List<Edge>> getAllEdge()throws JsonProcessingException{
        List<Edge> allEdge=edgeService.getAllEdge();
        return Result.success(allEdge);
    }
}
